using System;
using UnityEngine;

namespace PKGames.Localization
{
	[Serializable]
	public class LocalizedText
	{
		[SerializeField]
		private string _key;

		private readonly string _language;

		public string Key => _key;

		public string Value
		{
			get
			{
				if (MonoSingleton<LocationProvider>.Instance != null)
				{
					return MonoSingleton<LocationProvider>.Instance.GetString(_language, _key);
				}
				return string.Empty;
			}
		}

		public LocalizedText(string key, string language)
		{
			_key = key;
			_language = language;
		}
	}
}
